<!DOCTYPE html>
<?php

require_once './system/config.php';//Include de configuração



// Conexão com o banco de dados ////////////////////////////////////////////////////////////////////////////////////
$conn = new db();
$conn->open();

if($_SESSION['logado']  == 1){
     header("location: index.php?p=registrar");
}

$tpl = new TemplatePower( VIEW_PATH."login_template.html" );//instancia objeto TemplatePower, cria view no html principal
$tpl->assignGlobal('APP_NAME', APP_NAME);//seta variavel global
$tpl->assignInclude( "modulos", VIEW_PATH."login.html" );
$tpl->prepare();

$teste = DBUtils::getRows("select * from usuarios");


foreach ($teste as $row):
        $tpl->newBlock( "test" );
        $tpl->assign(Array(  "teste" => $row['nome'], "id" => $row['id_user']));
endforeach;

$tpl->printToScreen();

$conn->close();